home *** CD-ROM | disk | FTP | other *** search
- /*
- File: DebugUtil.c
-
- Contains: A Sample application for High-level text conversion
-
- Version: Technology: System 8
- Release: Daruma Developer Release 1
-
- Copyright: 1998 by Apple Computer, Inc., all rights reserved
-
- Contact: daruma@apple.com
-
- */
-
-
- #include "DebugUtil.h"
- #include <stdio.h>
- #include <string.h>
-
- #if __MWERKS__
- #pragma mpwc_newline off
- #endif
-
- void DebugPrint( char * assertionString,
- char * exceptionString,
- char * errorString,
- char * fileName,
- long lineNumber,
- void * value)
- {
- char msg[256];
-
- char exceptionStr[2], errStr[2];
-
- if (exceptionString == nil)
- {
- exceptionStr[0] = 0;
- exceptionString = &exceptionStr[0];
- }
-
- if ( errorString == nil)
- {
- errStr[0] = 0;
- errorString = &errStr[0];
- }
-
- sprintf(msg+1, "Assert Failed\rAssert %s = %ld\rException %s\r%s\rFile %s Line %ld\r",
- assertionString,
- value,
- exceptionString,
- errorString,
- fileName, lineNumber);
- msg[0] = strlen( msg+1 );
-
- DebugStr((StringPtr)msg);
- }
-
- #if __MWERKS__
- #pragma mpwc_newline reset
- #endif
-
-
-